<ion-view >
    <ion-nav-title>{{param.title | defString }}</ion-nav-title>
    <ion-nav-buttons side="left">
        <back-button></back-button>
    </ion-nav-buttons>
    <ion-content ng-class="{'has-loading': isOffline}">

        <ion-refresher pulling-text={{PULLING_TEXT}} pulling-icon="" refreshing-text={{REFRESHING_TEXT}}
                       on-refresh="doRefresh()"></ion-refresher>

        <!-- unlimited -->
        <div class="unlimited unlimited-item" ng-show="!param.duration_detail">
            <!-- item -->
            <div class="on">
                <div class="hd">
                    <concern></concern>
                    <h2 class="prodName">{{fund.prod_name | defString }}</h2>
                </div>
                <!-- income items -->
                <ul class="income-items clearfix">
                    <li ng-if="fund.price_increase_year">
                        <em class="{{fund.price_increase_year < 0 ? 'inc_' : 'inc'}}">{{fund.price_increase_year | defNumber : 2}}<sub>%</sub></em>近一年净值涨幅
                    </li>
                    <li><em class="{{fund.price_increase_month6 < 0 ? 'inc_' : 'inc'}}">{{fund.price_increase_month6 | defNumber : 2}}<sub>%</sub></em>近半年净值涨幅</li>
                    <li><em class="{{fund.price_increase_month1 < 0 ? 'inc_' : 'inc'}}">{{fund.price_increase_month1 | defNumber : 2}}<sub>%</sub></em>近一月净值涨幅</li>
                    <li><em>{{fund.prod_nav | defNumber:4}}<sub>元</sub></em>最新价（单位净值）</li>
                    <li><em>{{fund.prod_scale | defNumber : 2}}<sub>亿</sub></em>已售份额</li>
                </ul>
                <time ng-if="fund.prod_status!=4 && param.show_chart">累计净值走势更新日期：<span>{{fund.data_date}}</span></time>
                <!-- chart -->
                <div class="chart" ng-if="fund.prod_status!=4 && param.show_chart">
                    <!--<div class="mask"></div>-->
                    <highchart config="param.historyNavChartConfig"></highchart>
                </div>
            </div>
        </div>
        <!-- panel -->
        <div class="panel" ng-show="!param.duration_detail">
            <div class="item">
                <span class="title">基金类型</span>
                <span class="rtl">{{fund.prod_catalog_name | defString}}</span>
            </div>
            <div class="item">
                <span class="title">起购金额</span>
                <span class="rtl">{{fund.prod_min_subscribe | prodMinSubscribe : 2}}</span>
            </div>
            <div class="item" ng-class="{grp : fund.prod_duration_desc}" ng-if="fund.prod_status!=4&&fund.prod_status!=5">
                <a ng-click="showProdDurationDetail()">
                    <span class="title">期限</span>
                    <span class="rtl">{{fund.prod_duration | defNumber : null :'天'}}</span>
                </a>
            </div>
            <div class="item" ng-class="{grp : fund.prod_duration_desc}"  ng-if="fund.prod_status==4">
                <a ng-click="showProdDurationDetail()">
                    <span class="title">认购期</span>
                    <span class="rtl">{{fund.prod_attr_ext_info.prod_persub_desc}}</span>
                </a>
            </div>
            <div class="item" ng-class="{grp : fund.prod_duration_desc}"  ng-if="fund.prod_status==5">
                <a ng-click="showProdDurationDetail()">
                    <span class="title">封闭期</span>
                    <span class="rtl">{{fund.prod_attr_ext_info.prod_close_desc}}</span>
                </a>
            </div>
            <div class="item">
                <span class="title">风险</span>
                <span class="rtl">{{fund.prod_risk_level | dictionary : 'prodRisks'}}</span>
            </div>
            <div class="item" ng-show="fund.prod_grade_level">
                <span class="title">基金评级&nbsp;&nbsp;<a class="icon_help" ng-href="#/help-item/1839">?</a></span>
                <span class="rtl"><em class="grade {{'g' + fund.prod_grade_level}}"></em></span>
            </div>
            <div class="item group">
                <a href="#/tab/product-detail/{{fund.prod_code}}">了解更多产品详情</a>
            </div>
        </div>
        <div class="little-tip" ng-show="!param.duration_detail">基金有风险，投资需谨慎！购买前需仔细阅读基金合同和招募说明书等法律文件。</div>
        <!-- panel -->
        <div class="panel grpDetail word-wrap" style="padding-top: 15px" ng-show="param.duration_detail" ng-bind-html="fund.prod_duration_desc"></div>
    </ion-content>

    <ion-footer-bar class="footer" ng-show="!param.duration_detail">
        <dl>
            <dt>购买费率：<em>{{fund.prod_rate | defString}}</em>%</dt>
            <dd>
                <a ng-if="fund.prod_status== 0 || fund.prod_status == 3 || fund.prod_status == 4" class="btn"
                   buy-button prod_code="{{fund.prod_code}}" prod_source="{{fund.prod_source}}">购买</a>
                <a ng-if="fund.prod_status== 2" class="btn disable">暂停申购</a>
                <a ng-if="fund.prod_status== 5" class="btn disable">封闭期</a>
                <a ng-if="fund.prod_status== 1" class="btn disable">暂停交易</a>
            </dd>
        </dl>
    </ion-footer-bar>
</ion-view>